package console.gui.windows;

import java.awt.Desktop;
import java.net.URI;



/**
 *
 * @author Michael Hanns
 *
 */
public class About extends javax.swing.JDialog {


	private static final long serialVersionUID = 3092351210911561584L;
	
	/** Creates new form About */
    public About(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    
    private void openURL(String arg) {
        Desktop desktop = Desktop.getDesktop();

        try {
            URI uri = new java.net.URI(arg);
            desktop.browse(uri);
        } catch (Exception e) {
            System.err.println(e.getMessage());
        }

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        aboutHeaderLabel = new javax.swing.JLabel();
        descTextLn1 = new javax.swing.JLabel();
        descTextLn2 = new javax.swing.JLabel();
        descTextLn3 = new javax.swing.JLabel();
        descTextLn4 = new javax.swing.JLabel();
        closeButton = new javax.swing.JButton();
        websiteButton = new javax.swing.JButton();
        descTextLn5 = new javax.swing.JLabel();
        descTextLn6 = new javax.swing.JLabel();
        descTextLn7 = new javax.swing.JLabel();
        descTextLn8 = new javax.swing.JLabel();
        descTextLn9 = new javax.swing.JLabel();
        descTextLn10 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("About");
        setBackground(java.awt.Color.black);
        setLocationByPlatform(true);

        aboutHeaderLabel.setFont(new java.awt.Font("Courier New", 1, 18)); // NOI18N
        aboutHeaderLabel.setText("What is Thy Name, Adventurer?");

        descTextLn1.setText("WITNA is a multi-user dungeon (MUD) engine, server and editor developed for [52.497]");

        descTextLn2.setText("Individual Project at the Department of Computer and Information Sciences of Strathclyde");

        descTextLn3.setText("WITNA is best used on a system running Windows 7 x64 or OSX Mountain Lion, running the");

        descTextLn4.setText("Wiki at the official website.");

        closeButton.setText("Close");
        closeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                closeButtonActionPerformed(evt);
            }
        });

        websiteButton.setText("Website");
        websiteButton.setMargin(new java.awt.Insets(2, 12, 2, 12));
        websiteButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                websiteButtonActionPerformed(evt);
            }
        });

        descTextLn5.setText("University by Michael Hanns.");

        descTextLn6.setText("This software is available free of charge at the official WITNA website and will continue to");

        descTextLn7.setText("be supported by software updates at irregular intervals. Development news and community");

        descTextLn8.setText("tools to allow users to distribute their modules and/or download other users creations can");

        descTextLn9.setText("all be found at the official WITNA website.");

        descTextLn10.setText("Java Runtime Environment v1.6 or later. For further information, please consult the WITNA");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(descTextLn9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(descTextLn7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(descTextLn8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(descTextLn6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(aboutHeaderLabel, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(descTextLn3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(descTextLn4, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(descTextLn1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(descTextLn5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(descTextLn2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(descTextLn10)
                        .addGap(0, 0, Short.MAX_VALUE))))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(websiteButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(closeButton)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(aboutHeaderLabel)
                .addGap(18, 18, 18)
                .addComponent(descTextLn1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(descTextLn2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(descTextLn5)
                .addGap(18, 18, 18)
                .addComponent(descTextLn6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(descTextLn7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(descTextLn8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(descTextLn9)
                .addGap(18, 18, 18)
                .addComponent(descTextLn3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(descTextLn10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(descTextLn4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(closeButton)
                    .addComponent(websiteButton))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed
        dispose();
    }//GEN-LAST:event_closeButtonActionPerformed

    private void websiteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_websiteButtonActionPerformed
        openURL("http://www.whatisthynameadventurer.com");
    }//GEN-LAST:event_websiteButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel aboutHeaderLabel;
    private javax.swing.JButton closeButton;
    private javax.swing.JLabel descTextLn1;
    private javax.swing.JLabel descTextLn10;
    private javax.swing.JLabel descTextLn14;
    private javax.swing.JLabel descTextLn15;
    private javax.swing.JLabel descTextLn16;
    private javax.swing.JLabel descTextLn17;
    private javax.swing.JLabel descTextLn18;
    private javax.swing.JLabel descTextLn19;
    private javax.swing.JLabel descTextLn2;
    private javax.swing.JLabel descTextLn20;
    private javax.swing.JLabel descTextLn21;
    private javax.swing.JLabel descTextLn3;
    private javax.swing.JLabel descTextLn4;
    private javax.swing.JLabel descTextLn5;
    private javax.swing.JLabel descTextLn6;
    private javax.swing.JLabel descTextLn7;
    private javax.swing.JLabel descTextLn8;
    private javax.swing.JLabel descTextLn9;
    private javax.swing.JPanel techPanel;
    private javax.swing.JPanel techPanel1;
    private javax.swing.JButton websiteButton;
    private javax.swing.JLabel youAreRunningJRELabel;
    private javax.swing.JLabel youAreRunningJRELabel1;
    private javax.swing.JLabel youAreRunningLabel;
    private javax.swing.JLabel youAreRunningLabel1;
    private javax.swing.JLabel youAreRunningOSLabel;
    private javax.swing.JLabel youAreRunningOSLabel1;
    // End of variables declaration//GEN-END:variables
}
